package com.yhsoft.sys.controller.request;

import com.yhsoft.sys.entity.CompanyInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author: yyyyyyyh
 * @create: 2023-09-23
 * @Version 1.0
 **/
@Data
public class DistributorInVo {

    /**
     * id
     */
    @ApiModelProperty("渠道商ID，新增不传，修改传")
    private Integer id;

    /**
     * 企业名称
     */
    @ApiModelProperty("企业名称")
    private String companyName;

    /**
     * 法定代表人
     */
    @ApiModelProperty("法定代表人")
    private String corporation;

    /**
     * 地址
     */
    @ApiModelProperty("省市")
    private String address;

    /**
     * 详细地址
     */
    @ApiModelProperty("详细地址")
    private String detailAddress;

    /**
     * 公司官网
     */
    @ApiModelProperty("公司官网")
    private String website;

    /**
     * 公司联系电话
     */
    @ApiModelProperty("公司联系电话")
    private String companyPhone;

    /**
     * 公司联系邮箱
     */
    @ApiModelProperty("公司联系邮箱")
    private String companyEmail;

    /**
     * 联系人
     */
    @ApiModelProperty("联系人")
    private String contacts;

    /**
     * 联系人电话
     */
    @ApiModelProperty("联系人电话")
    private String contactsPhone;

    /**
     * 联系人邮箱
     */
    @ApiModelProperty("联系人邮箱")
    private String contactsEmail;

    /**
     * 默认服务费;
     */
    @NotBlank(message = "默认服务费不能为空！")
    @ApiModelProperty("默认服务费")
    private String defaultCharge;

    /**
     * 授信额度
     */
    @NotBlank(message = "授信额度不能为空！")
    @ApiModelProperty("授信额度")
    private String trustLimit;

    /**
     * 营业执照
     */
    @ApiModelProperty("营业执照图片地址")
    private String businessLicensePic;

    /**
     * logo
     */
    @ApiModelProperty("logo图片地址")
    private String logoIcon;

    /**
     * 小程序二维码
     */
    @ApiModelProperty("小程序二维码")
    private String wxAppQrCode;

    public void valueOf(CompanyInfo companyInfo) {
        this.setId(companyInfo.getId());
        this.setCompanyName(companyInfo.getCompanyName());
        this.setAddress(companyInfo.getAddress());
        this.setDetailAddress(companyInfo.getDetailAddress());
        this.setCompanyPhone(companyInfo.getCompanyPhone());
        this.setContactsPhone(companyInfo.getContactsPhone());
        this.setCompanyEmail(companyInfo.getCompanyEmail());
        this.setCorporation(companyInfo.getCorporation());
        this.setWebsite(companyInfo.getWebsite());
        this.setContacts(companyInfo.getContacts());
        this.setContactsPhone(companyInfo.getContactsPhone());
        this.setContactsEmail(companyInfo.getContactsEmail());
        this.setDefaultCharge(companyInfo.getDefaultCharge());
        this.setTrustLimit(companyInfo.getTrustLimit());
        this.setBusinessLicensePic(companyInfo.getBusinessLicensePic());
        this.setLogoIcon(companyInfo.getLogoIcon());
        this.setWxAppQrCode(companyInfo.getWxAppQrCode());
    }
}
